﻿using Autodesk.Revit.DB;
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Globalization;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Data;

namespace RevitProject.SpaceManager.Converters
{
    public class IsValidElementIdConverter : IValueConverter
    {
        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            bool isValid = value is ElementId id && id != null && id != ElementId.InvalidElementId;
            Debug.WriteLine($"IsValidElementIdConverter: Input='{value}', IsValid={isValid}"); // 添加日志
            return isValid;
        }

        public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
        {
            throw new NotImplementedException();
        }
    }
}
